blob: 48c4c0ef58c2e3a1556d98869623fc102a4e0a33 [file] [log] [blame]
Junio C Hamanod9d71c02006-02-08 00:52:331<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6<meta name="generator" content="AsciiDoc 7.0.2" />
7<style type="text/css">
8/* Debug borders */
9p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
10/*
11 border: 1px solid red;
12*/
13}
14
15body {
16 margin: 1em 5% 1em 5%;
17}
18
19a { color: blue; }
20a:visited { color: fuchsia; }
21
22em {
23 font-style: italic;
24}
25
26strong {
27 font-weight: bold;
28}
29
30tt {
31 color: navy;
32}
33
34h1, h2, h3, h4, h5, h6 {
35 color: #527bbd;
36 font-family: sans-serif;
37 margin-top: 1.2em;
38 margin-bottom: 0.5em;
39 line-height: 1.3;
40}
41
42h1 {
43 border-bottom: 2px solid silver;
44}
45h2 {
46 border-bottom: 2px solid silver;
47 padding-top: 0.5em;
48}
49
50div.sectionbody {
51 font-family: serif;
52 margin-left: 0;
53}
54
55hr {
56 border: 1px solid silver;
57}
58
59p {
60 margin-top: 0.5em;
61 margin-bottom: 0.5em;
62}
63
64pre {
65 padding: 0;
66 margin: 0;
67}
68
69span#author {
70 color: #527bbd;
71 font-family: sans-serif;
72 font-weight: bold;
73 font-size: 1.2em;
74}
75span#email {
76}
77span#revision {
78 font-family: sans-serif;
79}
80
81div#footer {
82 font-family: sans-serif;
83 font-size: small;
84 border-top: 2px solid silver;
85 padding-top: 0.5em;
86 margin-top: 4.0em;
87}
88div#footer-text {
89 float: left;
90 padding-bottom: 0.5em;
91}
92div#footer-badges {
93 float: right;
94 padding-bottom: 0.5em;
95}
96
97div#preamble,
98div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
99div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
100div.admonitionblock {
101 margin-right: 10%;
102 margin-top: 1.5em;
103 margin-bottom: 1.5em;
104}
105div.admonitionblock {
106 margin-top: 2.5em;
107 margin-bottom: 2.5em;
108}
109
110div.content { /* Block element content. */
111 padding: 0;
112}
113
114/* Block element titles. */
115div.title, caption.title {
116 font-family: sans-serif;
117 font-weight: bold;
118 text-align: left;
119 margin-top: 1.0em;
120 margin-bottom: 0.5em;
121}
122div.title + * {
123 margin-top: 0;
124}
125
126td div.title:first-child {
127 margin-top: 0.0em;
128}
129div.content div.title:first-child {
130 margin-top: 0.0em;
131}
132div.content + div.title {
133 margin-top: 0.0em;
134}
135
136div.sidebarblock > div.content {
137 background: #ffffee;
138 border: 1px solid silver;
139 padding: 0.5em;
140}
141
142div.listingblock > div.content {
143 border: 1px solid silver;
144 background: #f4f4f4;
145 padding: 0.5em;
146}
147
148div.quoteblock > div.content {
149 padding-left: 2.0em;
150}
151div.quoteblock .attribution {
152 text-align: right;
153}
154
155div.admonitionblock .icon {
156 vertical-align: top;
157 font-size: 1.1em;
158 font-weight: bold;
159 text-decoration: underline;
160 color: #527bbd;
161 padding-right: 0.5em;
162}
163div.admonitionblock td.content {
164 padding-left: 0.5em;
165 border-left: 2px solid silver;
166}
167
168div.exampleblock > div.content {
169 border-left: 2px solid silver;
170 padding: 0.5em;
171}
172
173div.verseblock div.content {
174 white-space: pre;
175}
176
177div.imageblock div.content { padding-left: 0; }
178div.imageblock img { border: 1px solid silver; }
179span.image img { border-style: none; }
180
181dl {
182 margin-top: 0.8em;
183 margin-bottom: 0.8em;
184}
185dt {
186 margin-top: 0.5em;
187 margin-bottom: 0;
188 font-style: italic;
189}
190dd > *:first-child {
191 margin-top: 0;
192}
193
194ul, ol {
195 list-style-position: outside;
196}
197ol.olist2 {
198 list-style-type: lower-alpha;
199}
200
201div.tableblock > table {
202 border-color: #527bbd;
203 border-width: 3px;
204}
205thead {
206 font-family: sans-serif;
207 font-weight: bold;
208}
209tfoot {
210 font-weight: bold;
211}
212
213div.hlist {
214 margin-top: 0.8em;
215 margin-bottom: 0.8em;
216}
217td.hlist1 {
218 vertical-align: top;
219 font-style: italic;
220 padding-right: 0.8em;
221}
222td.hlist2 {
223 vertical-align: top;
224}
225
226@media print {
227 div#footer-badges { display: none; }
228}
229include::./stylesheets/xhtml11-manpage.css[]
230/* Workarounds for IE6's broken and incomplete CSS2. */
231
232div.sidebar-content {
233 background: #ffffee;
234 border: 1px solid silver;
235 padding: 0.5em;
236}
237div.sidebar-title, div.image-title {
238 font-family: sans-serif;
239 font-weight: bold;
240 margin-top: 0.0em;
241 margin-bottom: 0.5em;
242}
243
244div.listingblock div.content {
245 border: 1px solid silver;
246 background: #f4f4f4;
247 padding: 0.5em;
248}
249
250div.quoteblock-content {
251 padding-left: 2.0em;
252}
253
254div.exampleblock-content {
255 border-left: 2px solid silver;
256 padding-left: 0.5em;
257}
258</style>
259<title>git-show(1)</title>
260</head>
261<body>
262<div id="header">
263<h1>
264git-show(1) Manual Page
265</h1>
266<h2>NAME</h2>
267<div class="sectionbody">
268<p>git-show -
Junio C Hamano7d23f5e2006-12-16 07:44:04269 Show various types of objects
Junio C Hamanod9d71c02006-02-08 00:52:33270</p>
271</div>
272</div>
273<h2>SYNOPSIS</h2>
274<div class="sectionbody">
Junio C Hamano7d23f5e2006-12-16 07:44:04275<p><em>git-show</em> [options] &lt;object&gt;&#8230;</p>
Junio C Hamanod9d71c02006-02-08 00:52:33276</div>
277<h2>DESCRIPTION</h2>
278<div class="sectionbody">
Junio C Hamano7d23f5e2006-12-16 07:44:04279<p>Shows one or more objects (blobs, trees, tags and commits).</p>
280<p>For commits it shows the log message and textual diff. It also
281presents the merge commit in a special format as produced by
282<em>git-diff-tree --cc</em>.</p>
283<p>For tags, it shows the tag message and the referenced objects.</p>
284<p>For trees, it shows the names (equivalent to <a href="git-ls-tree.html">git-ls-tree(1)</a>
285with --name-only).</p>
286<p>For plain blobs, it shows the plain contents.</p>
Junio C Hamanod3339982007-02-09 08:38:48287<p>The command takes options applicable to the <a href="git-diff-tree.html">git-diff-tree(1)</a> command to
288control how the changes the commit introduces are shown.</p>
Junio C Hamanod9d71c02006-02-08 00:52:33289<p>This manual page describes only the most frequently used options.</p>
290</div>
291<h2>OPTIONS</h2>
292<div class="sectionbody">
293<dl>
294<dt>
Junio C Hamano775a0f42006-12-31 01:19:14295&lt;object&gt;
Junio C Hamanod9d71c02006-02-08 00:52:33296</dt>
297<dd>
298<p>
Junio C Hamano775a0f42006-12-31 01:19:14299 The name of the object to show.
Junio C Hamano2d47c622007-01-18 06:24:10300 For a more complete list of ways to spell object names, see
301 "SPECIFYING REVISIONS" section in <a href="git-rev-parse.html">git-rev-parse(1)</a>.
Junio C Hamanod9d71c02006-02-08 00:52:33302</p>
303</dd>
304<dt>
Junio C Hamanoa340aaa2006-11-23 02:47:33305--pretty[=<em>&lt;format&gt;</em>]
Junio C Hamanod9d71c02006-02-08 00:52:33306</dt>
307<dd>
308<p>
Junio C Hamanoa340aaa2006-11-23 02:47:33309 Pretty-prints the details of a commit. <tt>--pretty</tt>
310 without an explicit <tt>=&lt;format&gt;</tt> defaults to <em>medium</em>.
311 If the commit is a merge, and if the pretty-format
312 is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
313 inserted before the <em>Author:</em> line. This line begins with
314 "Merge: " and the sha1s of ancestral commits are printed,
315 separated by spaces. Note that the listed commits may not
316 necessarily be the list of the <strong>direct</strong> parent commits if you
317 have limited your view of history: for example, if you are
318 only interested in changes related to a certain directory or
319 file. Here are some additional details for each format:
Junio C Hamanod9d71c02006-02-08 00:52:33320</p>
Junio C Hamanoa340aaa2006-11-23 02:47:33321<ul>
322<li>
323<p>
324<em>oneline</em>
325</p>
326<div class="literalblock">
327<div class="content">
328<pre><tt>&lt;sha1&gt; &lt;title line&gt;</tt></pre>
329</div></div>
330<p>This is designed to be as compact as possible.</p>
331</li>
332<li>
333<p>
334<em>short</em>
335</p>
336<div class="literalblock">
337<div class="content">
338<pre><tt>commit &lt;sha1&gt;
339Author: &lt;author&gt;</tt></pre>
340</div></div>
341<div class="literalblock">
342<div class="content">
343<pre><tt>&lt;title line&gt;</tt></pre>
344</div></div>
345</li>
346<li>
347<p>
348<em>medium</em>
349</p>
350<div class="literalblock">
351<div class="content">
352<pre><tt>commit &lt;sha1&gt;
353Author: &lt;author&gt;
354Date: &lt;date&gt;</tt></pre>
355</div></div>
356<div class="literalblock">
357<div class="content">
358<pre><tt>&lt;title line&gt;</tt></pre>
359</div></div>
360<div class="literalblock">
361<div class="content">
362<pre><tt>&lt;full commit message&gt;</tt></pre>
363</div></div>
364</li>
365<li>
366<p>
367<em>full</em>
368</p>
369<div class="literalblock">
370<div class="content">
371<pre><tt>commit &lt;sha1&gt;
372Author: &lt;author&gt;
373Commit: &lt;committer&gt;</tt></pre>
374</div></div>
375<div class="literalblock">
376<div class="content">
377<pre><tt>&lt;title line&gt;</tt></pre>
378</div></div>
379<div class="literalblock">
380<div class="content">
381<pre><tt>&lt;full commit message&gt;</tt></pre>
382</div></div>
383</li>
384<li>
385<p>
386<em>fuller</em>
387</p>
388<div class="literalblock">
389<div class="content">
390<pre><tt>commit &lt;sha1&gt;
391Author: &lt;author&gt;
392AuthorDate: &lt;date &amp; time&gt;
393Commit: &lt;committer&gt;
394CommitDate: &lt;date &amp; time&gt;</tt></pre>
395</div></div>
396<div class="literalblock">
397<div class="content">
398<pre><tt>&lt;title line&gt;</tt></pre>
399</div></div>
400<div class="literalblock">
401<div class="content">
402<pre><tt>&lt;full commit message&gt;</tt></pre>
403</div></div>
404</li>
405<li>
406<p>
407<em>email</em>
408</p>
409<div class="literalblock">
410<div class="content">
411<pre><tt>From &lt;sha1&gt; &lt;date&gt;
412From: &lt;author&gt;
413Date: &lt;date &amp; time&gt;
414Subject: [PATCH] &lt;title line&gt;</tt></pre>
415</div></div>
416<div class="literalblock">
417<div class="content">
418<pre><tt>full commit message&gt;</tt></pre>
419</div></div>
420</li>
421<li>
422<p>
423<em>raw</em>
424</p>
425<p>The <em>raw</em> format shows the entire commit exactly as
426stored in the commit object. Notably, the SHA1s are
427displayed in full, regardless of whether --abbrev or
428--no-abbrev are used, and <em>parents</em> information show the
429true parent commits, without taking grafts nor history
430simplification into account.</p>
431</li>
432</ul>
Junio C Hamanod9d71c02006-02-08 00:52:33433</dd>
Junio C Hamano775a0f42006-12-31 01:19:14434<dt>
435--encoding[=&lt;encoding&gt;]
436</dt>
437<dd>
438<p>
439 The commit objects record the encoding used for the log message
440 in their encoding header; this option can be used to tell the
441 command to re-code the commit log message in the encoding
442 preferred by the user. For non plumbing commands this
443 defaults to UTF-8.
444</p>
445</dd>
Junio C Hamanod9d71c02006-02-08 00:52:33446</dl>
447</div>
Junio C Hamano7d23f5e2006-12-16 07:44:04448<h2>EXAMPLES</h2>
449<div class="sectionbody">
450<dl>
451<dt>
452git show v1.0.0
453</dt>
454<dd>
455<p>
Junio C Hamano775a0f42006-12-31 01:19:14456 Shows the tag <tt>v1.0.0</tt>, along with the object the tags
457 points at.
Junio C Hamano7d23f5e2006-12-16 07:44:04458</p>
459</dd>
460<dt>
461
462</dt>
463<dd>
464<p>
465 Shows the tree pointed to by the tag <tt>v1.0.0</tt>.
466</p>
467</dd>
468</dl>
469<p>git show next~10:Documentation/README
470 Shows the contents of the file <tt>Documentation/README</tt> as
471 they were current in the 10th last commit of the branch
472 <tt>next</tt>.</p>
473<p>git show master:Makefile master:t/Makefile
474 Concatenates the contents of said Makefiles in the head
475 of the branch <tt>master</tt>.</p>
476</div>
Junio C Hamano775a0f42006-12-31 01:19:14477<h2>Discussion</h2>
478<div class="sectionbody">
479<p>At the core level, git is character encoding agnostic.</p>
480<ul>
481<li>
482<p>
483The pathnames recorded in the index and in the tree objects
484 are treated as uninterpreted sequences of non-NUL bytes.
485 What readdir(2) returns are what are recorded and compared
486 with the data git keeps track of, which in turn are expected
487 to be what lstat(2) and creat(2) accepts. There is no such
488 thing as pathname encoding translation.
489</p>
490</li>
491<li>
492<p>
493The contents of the blob objects are uninterpreted sequence
494 of bytes. There is no encoding translation at the core
495 level.
496</p>
497</li>
498<li>
499<p>
500The commit log messages are uninterpreted sequence of non-NUL
501 bytes.
502</p>
503</li>
504</ul>
505<p>Although we encourage that the commit log messages are encoded
506in UTF-8, both the core and git Porcelain are designed not to
507force UTF-8 on projects. If all participants of a particular
508project find it more convenient to use legacy encodings, git
509does not forbid it. However, there are a few things to keep in
510mind.</p>
511<ol>
512<li>
513<p>
514<tt>git-commit-tree</tt> (hence, <tt>git-commit</tt> which uses it) issues
515 an warning if the commit log message given to it does not look
516 like a valid UTF-8 string, unless you explicitly say your
517 project uses a legacy encoding. The way to say this is to
518 have core.commitencoding in <tt>.git/config</tt> file, like this:
519</p>
520<div class="listingblock">
521<div class="content">
522<pre><tt>[core]
523 commitencoding = ISO-8859-1</tt></pre>
524</div></div>
525<p>Commit objects created with the above setting record the value
526of <tt>core.commitencoding</tt> in its <tt>encoding</tt> header. This is to
527help other people who look at them later. Lack of this header
528implies that the commit log message is encoded in UTF-8.</p>
529</li>
530<li>
531<p>
532<tt>git-log</tt>, <tt>git-show</tt> and friends looks at the <tt>encoding</tt>
533 header of a commit object, and tries to re-code the log
534 message into UTF-8 unless otherwise specified. You can
535 specify the desired output encoding with
536 <tt>core.logoutputencoding</tt> in <tt>.git/config</tt> file, like this:
537</p>
538<div class="listingblock">
539<div class="content">
540<pre><tt>[core]
541 logoutputencoding = ISO-8859-1</tt></pre>
542</div></div>
543<p>If you do not have this configuration variable, the value of
544<tt>core.commitencoding</tt> is used instead.</p>
545</li>
546</ol>
547<p>Note that we deliberately chose not to re-code the commit log
548message when a commit is made to force UTF-8 at the commit
549object level, because re-coding to UTF-8 is not necessarily a
550reversible operation.</p>
551</div>
Junio C Hamanod9d71c02006-02-08 00:52:33552<h2>Author</h2>
553<div class="sectionbody">
554<p>Written by Linus Torvalds &lt;torvalds@osdl.org&gt; and
Junio C Hamano775a0f42006-12-31 01:19:14555Junio C Hamano &lt;junkio@cox.net&gt;. Significantly enhanced by
556Johannes Schindelin &lt;Johannes.Schindelin@gmx.de&gt;.</p>
Junio C Hamanod9d71c02006-02-08 00:52:33557</div>
558<h2>Documentation</h2>
559<div class="sectionbody">
560<p>Documentation by David Greaves, Petr Baudis and the git-list &lt;git@vger.kernel.org&gt;.</p>
561<p>This manual page is a stub. You can help the git documentation by expanding it.</p>
562</div>
563<h2>GIT</h2>
564<div class="sectionbody">
565<p>Part of the <a href="git.html">git(7)</a> suite</p>
566</div>
567<div id="footer">
568<div id="footer-text">
Junio C Hamanod3339982007-02-09 08:38:48569Last updated 09-Feb-2007 08:38:37 UTC
Junio C Hamanod9d71c02006-02-08 00:52:33570</div>
571</div>
572</body>
573</html>